
// str的内容表示拥护在输入框中输入的内容
let str = '         hello world   ' ;

console.log( str.length );

let s1 = str.trim(); // 剔除首尾空白
console.log( s1 , s1.length , typeof( s1 ) );

let s2 = str.trimStart(); // 剔除首部空白
console.log( s2.length );

let s3 = str.trimEnd(); // 剔除尾部空白
console.log( s3.length );

let s4 = s1.concat( '!' ) ; // let s4 = s1 + '!' ;
console.log( s4 );